import re
a=0
kongbai=''
with open('C:/Users/24260/Desktop/后勤网站建设/hqgl_web/style/wenbenliebiao.less', 'r+') as f:
    temp=f.read()
    f.seek(0)
    f.truncate()
    test=re.sub(r': (.*?)rem',lambda x:': '+str(float(x.group(1))/2)+'rem',temp)
    f.write(test)


